
import { Request } from "@/until/request.js"

//登录接口
export const login = (obj, data) => Request.getData({
	url: `/api/user/login.do?username=${obj.username}&password=${obj.psw}`,
	method: "post",
	data
})
//首页接口
export const homeon = data => Request.getData({
	url: "/api/statistic/base_count.do",
	method: "get",
	data
})
//商品管理接口
export const shopList = data => Request.getData({
	url: "/api/product/list.do",
	method: "get",
	data
})
//商品管理分页接口
export const shopListPagination = data => Request.getData({
	url: "/api/product/list.do",
	method: "get",
	data
})

// 添加商品
export const addShip =(list,data) =>Request.getData({
    url:`/api/product/save.do?categoryId=${list.categoryId}&name=${list.name}&subtitle=${list.subtitle}&subImages=${list.subImages}&detail=${list.detail}&price=${list.price}&stock=${list.stock}&status=${list.status}&region=${list.region}`,
    method : 'get',
    data,
   
})
//上传图片
export const upimage = (data)=>Request.getData({
    url:`/api/product/upload.do`,
    method:"POST"
})

//品类1
export const category1 = (data)=>Request.getData({
    url:`/api/category/get_category.do`,
    method:"GET",
    params:data
})
//商品管理搜索
export const shopListSearch = data => Request.getData({
	url: "/api/product/search.do",
	method: "get",
	data
})
//商品管理上下架
export const shopSale = data => Request.getData({
	url: "/api/product/set_sale_status.do",
	method: "get",
	data
})

//添加商品
export const categoryList = data => Request.getData({
	url: "/api/category/get_category.do",
	method: "get",
	data
})

//品类管理
export const category = data => Request.getData({
	url: "/api/category/get_category.do",
	method: "get",
	data
})

//品类添加
export const addcategory = data => Request.getData({
    url:"/api/category/add_category.do",
    method:"POST",
    params:data
})

//查看子品类
export const categoryItem = data => Request.getData({
    url:"/api/category/get_deep_category.do",
    method:"POST",
    params:data
})
// 修改品类名称
export const setcategory = data => Request.getData({
    url:"/api/category/set_category_name.do",
    method:"POST",
    params:data
})

//商品详情
export const shopDetail = data => Request.getData({
	url: "/api/product/detail.do",
	method: "get",
	data
})
//商品编辑
export const shopUpdate = data => Request.getData({
	url: "/api/category/get_category.do",
	method: "get",
	data
})
//订单管理
export const order = data => Request.getData({
	url: "/api/order/list.do",
	method: "get",
	data
})
//订单查询
export const orderId = data => Request.getData({
	url: "/api/order/search.do",
	method: "get",
	data
})


//用户列表
export const userList = data => Request.getData({
	url: "/api/user/list.do",
	method: "post",
	data
})
//分页器
export const userPagination = data => Request.getData({
	url: `/api/user/list.do`,
	method: "get",
	data
})


